package weixin.sdk.msg.parser;

import org.jdom.Element;
import org.jdom.JDOMException;

import weixin.sdk.msg.vo.recv.WxRecvMsg;
import weixin.sdk.msg.vo.recv.WxRecvVoiceMsg;

/**
 * 接收语音消息类
 * @author xuxile 
 **/
public class WxRecvVoiceMsgParser extends WxRecvMsgBaseParser {

	@Override
	protected WxRecvVoiceMsg parser(Element root, WxRecvMsg msg) throws JDOMException {
		String mediaId = getElementText(root, "MediaId");
		String format = getElementText(root, "Format");
		String recognition = getElementText(root, "Recognition");
		return new WxRecvVoiceMsg(msg, mediaId, format, recognition);
	}

}
